package com.canteen.create.result;

public class RequestConstant {

    /**
     * 返回数据枚举
     */
    public enum WRAPPED_RESULT_TYPE {
        //错误类
        ERROR("error", 0),
        //警告类
        WARN("warn", 1),
        //info类
        INFO("info", 2);

        private String name;
        private int index;

        WRAPPED_RESULT_TYPE(String name, int index){
            this.name = name;
            this.index = index;
        }

        public int getIndex(){
            return this.index;
        }

        public String getName(){
            return this.name;
        }

    }

    /**
     * 返回结果枚举
     */
    public enum WRAPPED_RESULT_CODE {
        //成功
        CODE_O("successful",0),
        //登录错误
        CODE_1("loginError",1),
        //业务错误
        CODE_2("businessError",2),
        //多用户
        CODE_3("multiUser", 3);

        private int code;
        private String name;

        WRAPPED_RESULT_CODE(String name, int code){
            this.name = name;
            this.code = code;
        }

        public int getCode(){
            return code;
        }

        public String getName(){
            return name;
        }
    }
}
